﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;


namespace BingZi.HY.Core
{
	/// <summary>
	/// 角色应用权限表
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("角色应用权限表")]
	[BindTable("sys_RolePermission", Description = "角色应用权限表", ConnName = "System")]
	public partial class sys_RolePermission
	{
		#region 属性
		private Int32 _PermissionID;
		/// <summary>
		/// 角色应用权限自动ID
		/// </summary>
		[Description("角色应用权限自动ID")]
		[DataObjectField(false, true, false, 10)]
		[BindColumn(1, "PermissionID", "角色应用权限自动ID", "", "int", 10, 0, false)]
		public Int32 PermissionID
		{
			get { return _PermissionID; }
            set { if (OnPropertyChanging("PermissionID", value)) { _PermissionID = value; OnPropertyChanged("PermissionID"); } }
		}

		private Int32 _P_RoleID;
		/// <summary>
		/// 角色ID与sys_Roles表中RoleID相
		/// </summary>
		[Description("角色ID与sys_Roles表中RoleID相")]
		[DataObjectField(true, false, false, 10)]
		[BindColumn(2, "P_RoleID", "角色ID与sys_Roles表中RoleID相", "", "int", 10, 0, false)]
		public Int32 P_RoleID
		{
			get { return _P_RoleID; }
            set { if (OnPropertyChanging("P_RoleID", value)) { _P_RoleID = value; OnPropertyChanged("P_RoleID"); } }
		}

		private Int32 _P_ApplicationID;
		/// <summary>
		/// 角色所属应用ID与sys_Applicatio
		/// </summary>
		[Description("角色所属应用ID与sys_Applicatio")]
		[DataObjectField(true, false, false, 10)]
		[BindColumn(3, "P_ApplicationID", "角色所属应用ID与sys_Applicatio", "", "int", 10, 0, false)]
		public Int32 P_ApplicationID
		{
			get { return _P_ApplicationID; }
            set { if (OnPropertyChanging("P_ApplicationID", value)) { _P_ApplicationID = value; OnPropertyChanged("P_ApplicationID"); } }
		}

		private String _P_PageCode;
		/// <summary>
		/// 角色应用中页面权限代码
		/// </summary>
		[Description("角色应用中页面权限代码")]
		[DataObjectField(true, false, false, 20)]
		[BindColumn(4, "P_PageCode", "角色应用中页面权限代码", "", "varchar(20)", 0, 0, false)]
		public String P_PageCode
		{
			get { return _P_PageCode; }
            set { if (OnPropertyChanging("P_PageCode", value)) { _P_PageCode = value; OnPropertyChanged("P_PageCode"); } }
		}

		private Int32 _P_Value;
		/// <summary>
		/// 权限值
		/// </summary>
		[Description("权限值")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(5, "P_Value", "权限值", "", "int", 10, 0, false)]
		public Int32 P_Value
		{
			get { return _P_Value; }
            set { if (OnPropertyChanging("P_Value", value)) { _P_Value = value; OnPropertyChanged("P_Value"); } }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "PermissionID" : return _PermissionID;
					case "P_RoleID" : return _P_RoleID;
					case "P_ApplicationID" : return _P_ApplicationID;
					case "P_PageCode" : return _P_PageCode;
					case "P_Value" : return _P_Value;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "PermissionID" : _PermissionID = Convert.ToInt32(value); break;
					case "P_RoleID" : _P_RoleID = Convert.ToInt32(value); break;
					case "P_ApplicationID" : _P_ApplicationID = Convert.ToInt32(value); break;
					case "P_PageCode" : _P_PageCode = Convert.ToString(value); break;
					case "P_Value" : _P_Value = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得角色应用权限表字段名的快捷方式
		/// </summary>
        [CLSCompliant(false)]
		public class _
		{
			///<summary>
			/// 角色应用权限自动ID
			///</summary>
			public const String PermissionID = "PermissionID";

			///<summary>
			/// 角色ID与sys_Roles表中RoleID相
			///</summary>
			public const String P_RoleID = "P_RoleID";

			///<summary>
			/// 角色所属应用ID与sys_Applicatio
			///</summary>
			public const String P_ApplicationID = "P_ApplicationID";

			///<summary>
			/// 角色应用中页面权限代码
			///</summary>
			public const String P_PageCode = "P_PageCode";

			///<summary>
			/// 权限值
			///</summary>
			public const String P_Value = "P_Value";
		}
		#endregion
	}
}